Use ffmpeg, e.g.

ffmpeg -t 30.0 -i S_Movie_1_small.mp4 -f gif -s 1200x400 Creating_VR.gif

-t indicates how long in seconds
-i is input file
-f gif indicates that I want file in gif format
-s 1200x400 indicates the output size. Necessary as files get huge otherwise.